package com.gitee.wsl.flowing.sink

import kotlinx.io.IOException

interface Source<T>{
    /**
     * Removes at least 1, and up to `byteCount` bytes from this and appends them to `sink`. Returns
     * the number of bytes read, or -1 if this source is exhausted.
     */
    @Throws(IOException::class)
    fun read(sink: T, byteCount: Long): Long

    /** Returns the timeout for this source.  */
    fun timeout(): Timeout = Timeout.NONE
}